#pragma once
#ifndef VERTEX_TYPES_H
#define VERTEX_TYPES_H
#include <d3d9.h>
#define VERTEX_TYPE_GEOMETRY 0x0001
#define VERTEX_TYPE_NORMAL 0x0002
#define VERTEX_TYPE_TANGENT 0x0004
#define VERTEX_TYPE_BINORMAL 0x0008
#define VERTEX_TYPE_TEXTURE1 0x0010
#define VERTEX_TYPE_TEXTURE2 0x0020
#define VERTEX_TYPE_DIFFUSE 0x0040

struct TCOLORED_VERTEX
{
	float x, y, z;
	unsigned long color;
	static inline unsigned short GetVertexType()
	{
		return VERTEX_TYPE_GEOMETRY|VERTEX_TYPE_DIFFUSE;
	}
	static inline unsigned int GetFVF()
	{
		return D3DFVF_XYZ|D3DFVF_DIFFUSE;//Parte especifica de directX
	}
};
struct TTEXTURED_VERTEX
{
    float x, y, z, tu, tv;
    static inline unsigned short GetVertexType()
    {
        return VERTEX_TYPE_GEOMETRY|VERTEX_TYPE_TEXTURE1;
    }
    static inline unsigned int GetFVF()
    {
   		return D3DFVF_XYZ|D3DFVF_TEX1;
    }
};
struct TCOLORED_2TEXTURED_VERTEX
{
    float x, y, z;
    unsigned long color;
	float tu,tv,tu2,tv2;
    static inline unsigned short GetVertexType()
    {
        return VERTEX_TYPE_GEOMETRY|VERTEX_TYPE_DIFFUSE|VERTEX_TYPE_TEXTURE1|VERTEX_TYPE_TEXTURE2;
    }
    static inline unsigned int GetFVF()
    {
   		return D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1|D3DFVF_TEX2;
    }
};
struct TNORMAL_TEXTURED_VERTEX
{
	float x, y, z;
	float nx, ny, nz;
	float tu, tv;
	static inline unsigned short GetVertexType()
	{
		return VERTEX_TYPE_GEOMETRY | VERTEX_TYPE_TEXTURE1 | VERTEX_TYPE_NORMAL;
	}
	//especifico directX
	static inline unsigned int GetFVF()
	{
		return D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_NORMAL;
	}
};
struct TNORMAL_COLORED_2TEXTURED_VERTEX
{
	float x, y, z;
	float nx, ny, nz;
	unsigned long color;
	float tu, tv,tu2,tv2;
	static inline unsigned short GetVertexType()
	{
		return VERTEX_TYPE_GEOMETRY | VERTEX_TYPE_DIFFUSE | VERTEX_TYPE_TEXTURE1 | VERTEX_TYPE_TEXTURE2;
	}
	//especifico directX
	static inline unsigned int GetFVF()
	{
		return D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1 | D3DFVF_TEX2;
	}
};
struct TNORMAL_COLORED_VERTEX
{
    float x, y, z;
    float nx, ny,nz;
    unsigned long color;

    static inline unsigned short GetVertexType()
    {
		return VERTEX_TYPE_GEOMETRY|VERTEX_TYPE_DIFFUSE|VERTEX_TYPE_NORMAL;
    }
    static inline unsigned int GetFVF()
    {
   		return D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_NORMAL;
    }
};
struct TCOLORED_TEXTURED_VERTEX
{
    float x, y, z;
    unsigned long color;
    float tu,tv;

    static inline unsigned short GetVertexType()
    {
   		return VERTEX_TYPE_GEOMETRY|VERTEX_TYPE_DIFFUSE|VERTEX_TYPE_TEXTURE1;
    }
    static inline unsigned int GetFVF()
    {
   		return D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1;
    }
};
struct TNORMAL_COLORED_TANGENT_BINORMAL_2TEXTURED_VERTEX
{
    float x, y, z;
    float nx, ny,nz;
    unsigned long color;
    float tnx, tny, tnz;
    float bnx, bny, bnz;
    float tu,tv;
    float tu2,tv2;

    static inline unsigned short GetVertexType()
    {
   		return VERTEX_TYPE_GEOMETRY|VERTEX_TYPE_DIFFUSE|VERTEX_TYPE_TEXTURE1|VERTEX_TYPE_TEXTURE2|VERTEX_TYPE_NORMAL|VERTEX_TYPE_BINORMAL|VERTEX_TYPE_TANGENT;
    }
    static inline unsigned int GetFVF()
    {
   		return 0;
    }
};
struct T2TEXTURED_VERTEX
{
	float x, y, z;
	float tu, tv, tu2, tv2;
	static inline unsigned short GetVertexType()
	{
		return VERTEX_TYPE_GEOMETRY|VERTEX_TYPE_TEXTURE1|VERTEX_TYPE_TEXTURE2;
	}
	static inline unsigned int GetFVF()
	{
		return D3DFVF_XYZ|D3DFVF_TEX1|D3DFVF_TEX2;//Parte especifica de directX
	}
};
struct TNORMAL_COLORED_TEXTURED_VERTEX
{
	float x, y, z;
	float nx, ny, nz;
	unsigned long color;
	float tu, tv;

	static inline unsigned short GetVertexType()
	{
		return VERTEX_TYPE_GEOMETRY|VERTEX_TYPE_TEXTURE1|VERTEX_TYPE_DIFFUSE;
	}
	static inline unsigned int GetFVF()
	{
		return D3DFVF_XYZ|D3DFVF_TEX1|D3DFVF_DIFFUSE;//Parte especifica de directX
	}
};
struct TNORMAL_2TEXTURED_VERTEX
{
    float x, y, z;
    float nx, ny, nz;
    float tu, tv, tu2, tv2;

    static inline unsigned short GetVertexType()
    {
   		return VERTEX_TYPE_GEOMETRY|VERTEX_TYPE_NORMAL|VERTEX_TYPE_TEXTURE1|VERTEX_TYPE_TEXTURE2;
    }
    static inline unsigned int GetFVF()
    {
   		return D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1|D3DFVF_TEX2;
    }
};
struct TNORMAL_COLORED_TANGENT_BINORMAL_TEXTURED_VERTEX
{
    float x, y, z;
    float nx, ny, nz;
    unsigned long color;
    float tnx, tny, tnz;
    float bnx, bny, bnz;
    float tu, tv;
    static inline unsigned short GetVertexType()
    {
   		return VERTEX_TYPE_GEOMETRY|VERTEX_TYPE_NORMAL|VERTEX_TYPE_DIFFUSE|VERTEX_TYPE_TANGENT|VERTEX_TYPE_BINORMAL|VERTEX_TYPE_TEXTURE1;
    }
    static inline unsigned int GetFVF()
    {
   		return 0;
    }
};

#endif